package cn.loioi.websocket.pool;

import org.apache.commons.pool2.BaseKeyedPooledObjectFactory;
import org.apache.commons.pool2.PooledObject;
import org.apache.commons.pool2.impl.DefaultPooledObject;
import org.springframework.stereotype.Component;

/**
 * <br>
 * (c) Copyright 2016 by <br>
 * @description :连接池-创建对象工厂 <br>
 * @file_name :ConnecttionPool.java <br>
 * @author :yyzh <br>
 * @创建时间 :2016年2月3日 下午1:48:51
 */
@Component
public class ConnecttionPoolFactory extends BaseKeyedPooledObjectFactory<String, Connecttion> {

	@Override
	public Connecttion create(String account) throws Exception {
		return new Connecttion(account);
	}

	@Override
	public PooledObject<Connecttion> wrap(Connecttion value) {
		return new DefaultPooledObject<Connecttion>(value);
	}

}
